package com.wysql.ascost.model.info;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class InfoImportresult implements Serializable {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "主键ID")
    private String id;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "导入时间")
    private Date createtime;

    @ApiModelProperty(value = "批次信息")
    private String batchnum;

    @ApiModelProperty(value = "导入文件总数")
    private Integer total;

    @ApiModelProperty(value = "成功条数")
    private Integer successcount;

    @ApiModelProperty(value = "失败条数")
    private Integer failcount;

    @ApiModelProperty(value = "导入人员id")
    private String memberid;

    @ApiModelProperty(value = "备注")
    private String memo;

    @ApiModelProperty(value = "所属环节（1可研2初设3结算）")
    private Integer step;

    @ApiModelProperty(value = "工程类别（1基建类2业扩类3技改类4大修类）")
    private Integer type;


    public InfoImportresult(String id, Date createtime, String batchnum, Integer total, Integer successcount, Integer failcount, String memberid, String memo, Integer step, Integer type) {

        this.id = id;

        this.createtime = createtime;

        this.batchnum = batchnum;

        this.total = total;

        this.successcount = successcount;

        this.failcount = failcount;

        this.memberid = memberid;

        this.memo = memo;

        this.step = step;

        this.type = type;

    }


    public InfoImportresult() {
        super();
    }

    public String dateToStringConvert(Date date) {
        if (date != null) {
            return DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
        }
        return "";
    }


}